# def denglu():
#     username = input("请输入用户名: ")
#     password = input("请输入密码: ")
#
#     # 读取现有用户数据
#     users = load_users()
#
#     # 检查用户是否存在
#     if username not in users:
#         print("用户不存在，请先注册。")
#         return
#
#     # 检查密码是否正确
#     hashed_password = hashlib.sha256(password.encode()).hexdigest()
#     if users[username]["password"] != hashed_password:
#         print("密码错误，请重试。")
#         return
#
#     print("登录成功!")
# path = 'E:\\projects\\PycharmProjects\x08igdata33\\data\\zuoye'
# print(repr(path))
def denglu():
    res1=''
    while True:
        name=input('请输入您的姓名：')
        pwd=input('请输入您的密码：')
        f = open('E:\\projects\\PycharmProjects\\bigdata33\\data', mode='r', encoding='UTF-8')
        res1 = f.readlines()
        for i in res1:
            if i == name:
                print('此用户存在,登录成功')
            else:
                print('此用户不存在,请先注册')
def main():
    while True:
        print("请选择功能:")
        print("1.注册")
        print("2.登录")
        print("3.退出")
        xuanze=input('请输入选项：')
        if xuanze  == "2":
            denglu()
        elif xuanze  == "3":
            print("退出程序。")
            break
        else:
            print("没有此选项，请重新选择")
main()